package com.shrio;

import java.util.Arrays;

/**
 * Created by luojie on 2018/3/6.
 */
public class TestLj {

    public static void sort(int[] a){
        int temp = 0;
        for(int i=0 ;i < a.length-1; i++){
            for(int j = 0;j<a.length-i-1;j++){
                if(a[j] > a[j+1]){
                    temp = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = temp;
                }
            }
        }
    }

    public static void main(String[] args) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
//        Person person = Person.class.newInstance();
//        System.out.println("-------"+person);
//        Person person1 = (Person) Class.forName("com.shrio.Person").newInstance();
//        System.out.println("----------"+person1);
        int[] a = {1,2,3,6,5,7,9,8,4};
        sort(a);
        for(int i = 0; i < a.length; i++){
            System.out.print(a[i] +",");
        }
        System.out.println();
    }
}
